package com.scraper.service.impl;

import java.util.List;

import com.scraper.dao.CityDAO;
import com.scraper.model.City;
import com.scraper.service.CityManager;

public class CityManagerImpl implements CityManager {

	private CityDAO cityDAO;

	public void create(City city) {
		cityDAO.saveOrUpdate(city);
	}

	public City getCityByID(Integer id) {
		return cityDAO.get(id);
	}

	public List<City> getCityList() {
		return cityDAO.list();
	}

	public void setCityDAO(CityDAO cityDAO) {
		this.cityDAO = cityDAO;
	}

	public CityDAO getCityDAO() {
		return cityDAO;
	}

	public City getByName(String name) {
		return cityDAO.getByName(name);
	}

	public void delete(City city) {
		cityDAO.delete(city);
	}

}
